﻿using System.ComponentModel.DataAnnotations;
using Lbb.Localization;

namespace Lbb.DataAnnotations
{
    /// <summary>
    /// 指定数据字段中允许的最小和最大字符长度。
    /// </summary>
    /// <author>Chiron</author>
    public class NStringLengthAttribute : StringLengthAttribute
    {
        /// <summary>
        /// 指定字条串的最大长度
        /// </summary>
        /// <param name="maximumLength">字符串的最大长度。</param>
        public NStringLengthAttribute(int maximumLength)
            : base(maximumLength)
        {
            ErrorMessageResourceType = typeof(ErrorRes);
            ErrorMessageResourceName = "StringLength";
        }
    }
}
